<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Whisper: wave_io.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Whisper
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">wave_io.h</div>  </div>
</div>
<div class="contents">
<a href="wave__io_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef __WAVE_IO_H__</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define __WAVE_IO_H__ 1</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;<a class="code" href="sample__io_8h.html">sample_io.h</a>&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;<a class="code" href="riff__wave_8h.html">wave/riff_wave.h</a>&quot;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="riff__wave__writer_8h.html">wave/riff_wave_writer.h</a>&quot;</span>
<a name="l00007"></a>00007 
<a name="l00008"></a><a class="code" href="classCWaveIO.html">00008</a> <span class="keyword">class </span><a class="code" href="classCWaveIO.html">CWaveIO</a> : <span class="keyword">public</span> <a class="code" href="classISampleIO.html">ISampleIO</a>
<a name="l00009"></a>00009 {
<a name="l00010"></a>00010 <span class="keyword">public</span>:
<a name="l00014"></a>00014         <a class="code" href="classCWaveIO.html#a084f3edb7cd029cdb8af349fb3e256f3">CWaveIO</a>(<a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a> pAction,
<a name="l00015"></a>00015                         std::string pWavInputFile,
<a name="l00016"></a>00016                         std::string pWavOutputFile,
<a name="l00017"></a>00017                         <span class="keywordtype">double</span> pDiscardTime);
<a name="l00018"></a>00018 
<a name="l00022"></a>00022         <a class="code" href="classCWaveIO.html#a084f3edb7cd029cdb8af349fb3e256f3">CWaveIO</a>(<a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a> pAction, std::string pWavInputFile, <span class="keywordtype">bool</span> pReplayInput);
<a name="l00023"></a>00023 
<a name="l00027"></a>00027         <a class="code" href="classCWaveIO.html#a084f3edb7cd029cdb8af349fb3e256f3">CWaveIO</a>(<a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a> pAction,
<a name="l00028"></a>00028                         std::string pWavOutputFile,
<a name="l00029"></a>00029                         <a class="code" href="structNAudioFormats_1_1SStreamInfo.html">NAudioFormats::SStreamInfo</a> pStreamInfo);
<a name="l00030"></a>00030 
<a name="l00031"></a>00031         <span class="keyword">virtual</span> <a class="code" href="classCWaveIO.html#af0d39cbad670ee18970d39b4cbb011c4">~CWaveIO</a>();
<a name="l00032"></a>00032 
<a name="l00033"></a>00033         <span class="comment">/* START methods inherited by ISampleIO */</span>
<a name="l00034"></a>00034         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCWaveIO.html#aaa8e7eb8813f388fca7ca70205105d03">init</a>(<a class="code" href="properties__reader_8h.html#a67847fd00cb49d80dd45f61722eb9a43">CPropertiesReader</a> *pConfig);
<a name="l00035"></a>00035         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCWaveIO.html#a87e3fbd7fa9ba9555c72a5aade4494b4">destroy</a>();
<a name="l00036"></a>00036 
<a name="l00037"></a>00037         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCWaveIO.html#aa510ff6ab283ba7ce92e8405b5aed505">read</a>(<span class="keywordtype">void</span>** pData, <a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a>&amp; pAction, <span class="keywordtype">int</span> pTimeout = 1000);
<a name="l00041"></a>00041         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCWaveIO.html#aa510ff6ab283ba7ce92e8405b5aed505">read</a>(<span class="keywordtype">void</span>** pData, <a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a>&amp; pAction, <span class="keywordtype">int</span> pTimeout, <span class="keywordtype">int</span> pMaxRead);
<a name="l00042"></a>00042         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCWaveIO.html#a142ebb8a033f2ffc6f733c70a26ec7d0">write</a>(<span class="keywordtype">void</span>* pData, <span class="keyword">const</span> <a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a>&amp; pAction, <span class="keywordtype">int</span> pLength);
<a name="l00043"></a>00043 
<a name="l00044"></a>00044         <span class="keyword">virtual</span> <a class="code" href="structNAudioFormats_1_1SStreamInfo.html">NAudioFormats::SStreamInfo</a> <a class="code" href="classCWaveIO.html#a32288b446b36daf22a72ac1bdc4bb772">getStreamInfo</a>();
<a name="l00045"></a>00045         <span class="comment">/* END methods inherited by ISampleIO */</span>
<a name="l00046"></a>00046 
<a name="l00047"></a>00047 <span class="keyword">private</span>:
<a name="l00048"></a><a class="code" href="classCWaveIO.html#ab88b12dbc2d6f32cba9382df7a150fcd">00048</a>         <span class="keyword">static</span> <span class="keyword">const</span> std::string <a class="code" href="classCWaveIO.html#ab88b12dbc2d6f32cba9382df7a150fcd">sIniSectionName</a>;
<a name="l00049"></a>00049 
<a name="l00050"></a><a class="code" href="classCWaveIO.html#a87e105afa1a6bb0a49fa70abd3ec24ea">00050</a>         <span class="keyword">enum</span> <a class="code" href="classCWaveIO.html#a87e105afa1a6bb0a49fa70abd3ec24ea">EInitError</a> {
<a name="l00051"></a><a class="code" href="classCWaveIO.html#a87e105afa1a6bb0a49fa70abd3ec24eaab98f25e9388e0e349eaedaf646431d4e">00051</a>                 <a class="code" href="classCWaveIO.html#a87e105afa1a6bb0a49fa70abd3ec24eaab98f25e9388e0e349eaedaf646431d4e">INIT_NO_ERROR</a>          = 0,
<a name="l00052"></a>00052 
<a name="l00053"></a>00053                 <span class="comment">// errors</span>
<a name="l00054"></a><a class="code" href="classCWaveIO.html#a87e105afa1a6bb0a49fa70abd3ec24eaa4e0f9fce79ffab95e205f9a4b31c0219">00054</a>                 <a class="code" href="classCWaveIO.html#a87e105afa1a6bb0a49fa70abd3ec24eaa4e0f9fce79ffab95e205f9a4b31c0219">INIT_FAILURE</a>           = 1,
<a name="l00055"></a><a class="code" href="classCWaveIO.html#a87e105afa1a6bb0a49fa70abd3ec24eaa3ef548258c9cf797de95c46851163993">00055</a>                 <a class="code" href="classCWaveIO.html#a87e105afa1a6bb0a49fa70abd3ec24eaa3ef548258c9cf797de95c46851163993">INIT_WAVE_INPUT_ERROR</a>  = 2,
<a name="l00056"></a><a class="code" href="classCWaveIO.html#a87e105afa1a6bb0a49fa70abd3ec24eaaff880a13e3b8075553882625fbc22c49">00056</a>                 <a class="code" href="classCWaveIO.html#a87e105afa1a6bb0a49fa70abd3ec24eaaff880a13e3b8075553882625fbc22c49">INIT_WAVE_OUTPUT_ERROR</a> = 3,
<a name="l00057"></a>00057         };
<a name="l00058"></a>00058 
<a name="l00059"></a><a class="code" href="classCWaveIO.html#a840699af632277923a70a0228fb03256">00059</a>         <a class="code" href="classCWaveIO.html#a87e105afa1a6bb0a49fa70abd3ec24ea">EInitError</a> <a class="code" href="classCWaveIO.html#a840699af632277923a70a0228fb03256">mError</a>;
<a name="l00060"></a><a class="code" href="classCWaveIO.html#a3808e48d44b485bb520dad3c6035d010">00060</a>         <a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a> <a class="code" href="classCWaveIO.html#a3808e48d44b485bb520dad3c6035d010">mAction</a>;
<a name="l00061"></a><a class="code" href="classCWaveIO.html#a07addea538ef0c82d7c7428f1e150200">00061</a>         <a class="code" href="classCRiffWave.html">CRiffWave</a> *<a class="code" href="classCWaveIO.html#a07addea538ef0c82d7c7428f1e150200">mWavIn</a>;
<a name="l00062"></a><a class="code" href="classCWaveIO.html#abd638048ba09d8ff170aef8639406c4d">00062</a>         <a class="code" href="classCRiffWaveWriter.html">CRiffWaveWriter</a> *<a class="code" href="classCWaveIO.html#abd638048ba09d8ff170aef8639406c4d">mWavOut</a>;
<a name="l00063"></a><a class="code" href="classCWaveIO.html#a869289411bf4dec1b0c8a091a4303c16">00063</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *<a class="code" href="classCWaveIO.html#a869289411bf4dec1b0c8a091a4303c16">mReadByteBuffer</a>;
<a name="l00064"></a><a class="code" href="classCWaveIO.html#a06434e47bf8160e95b3ba05d09234a04">00064</a>         <span class="keywordtype">bool</span> <a class="code" href="classCWaveIO.html#a06434e47bf8160e95b3ba05d09234a04">mReplayInput</a>;
<a name="l00065"></a><a class="code" href="classCWaveIO.html#a8e4204695f7396613b8965ea3964d226">00065</a>         <span class="keywordtype">int</span> <a class="code" href="classCWaveIO.html#a8e4204695f7396613b8965ea3964d226">mDiscardByteCount</a>;
<a name="l00066"></a>00066 
<a name="l00067"></a><a class="code" href="classCWaveIO.html#a4baca210310c73d64ef3289ef2711598">00067</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCWaveIO.html#a4baca210310c73d64ef3289ef2711598">mBytePerSample</a>;
<a name="l00068"></a><a class="code" href="classCWaveIO.html#aae408d020756faba8e4b8457ed889bc8">00068</a>         <a class="code" href="structNAudioFormats_1_1SStreamInfo.html">NAudioFormats::SStreamInfo</a> <a class="code" href="classCWaveIO.html#aae408d020756faba8e4b8457ed889bc8">mStreamInfo</a>;
<a name="l00069"></a>00069 
<a name="l00070"></a><a class="code" href="classCWaveIO.html#ab3f14eee2da307b2e708de2601f3d774">00070</a>         <span class="keywordtype">bool</span> <a class="code" href="classCWaveIO.html#ab3f14eee2da307b2e708de2601f3d774">mReadInRealtime</a>;
<a name="l00071"></a>00071 
<a name="l00072"></a>00072         <a class="code" href="classCWaveIO.html#a084f3edb7cd029cdb8af349fb3e256f3">CWaveIO</a>(<span class="keyword">const</span> <a class="code" href="classCWaveIO.html">CWaveIO</a>&amp; );
<a name="l00073"></a>00073         <a class="code" href="classCWaveIO.html">CWaveIO</a>&amp; <a class="code" href="classCWaveIO.html#a19b7c3e5792af401a2eaa2703064e8a2">operator=</a>(<span class="keyword">const</span> <a class="code" href="classCWaveIO.html">CWaveIO</a>&amp; );
<a name="l00074"></a>00074 
<a name="l00075"></a>00075         <span class="keywordtype">bool</span> <a class="code" href="classCWaveIO.html#a3a46707de0b4dff1d2aabf37047d3212">openInputFile</a>(std::string pMonoWavInputFile);
<a name="l00076"></a>00076         <a class="code" href="namespaceNAudioFormats.html#a8819e97264e4bbfee5d0552ee4c36c7c">NAudioFormats::ESamplesWidth</a> <a class="code" href="classCWaveIO.html#a480c1f01295df571756ca8553b47490d">getSampleWidth</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pBitsPerSample);
<a name="l00077"></a>00077         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCWaveIO.html#a1261d34087c1ca3af7d988695252fd71">getBitsPerSample</a>(<a class="code" href="namespaceNAudioFormats.html#a8819e97264e4bbfee5d0552ee4c36c7c">NAudioFormats::ESamplesWidth</a> pSampleWidth);
<a name="l00078"></a>00078         <a class="code" href="namespaceNAudioFormats.html#a3bd6168a4f5f18e84873337a65d3062c">NAudioFormats::ECodec</a> <a class="code" href="classCWaveIO.html#a6f7f26afb68a4d90d3a13f6321464ea5">getCodec</a>(<a class="code" href="namespaceNWaveFormatTag.html#a984a591ddf2ea06019b5881d5b83364d">NWaveFormatTag::EFormatTag</a> pWaveFormatTag);
<a name="l00079"></a>00079         <a class="code" href="namespaceNWaveFormatTag.html#a984a591ddf2ea06019b5881d5b83364d">NWaveFormatTag::EFormatTag</a> <a class="code" href="classCWaveIO.html#a1f42a89f715cca459f1d57879dec2b4e">getWaveFormatTag</a>(<a class="code" href="namespaceNAudioFormats.html#a3bd6168a4f5f18e84873337a65d3062c">NAudioFormats::ECodec</a> pCodec);
<a name="l00080"></a>00080 };
<a name="l00081"></a>00081 
<a name="l00082"></a>00082 <span class="preprocessor">#endif </span><span class="comment">/* __WAVE_IO_H__ */</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 25 2012 22:00:40 for Whisper by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
